home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / D-G / GetKeys / Read me -- GetKeys < prev   
Encoding:
Text File  |  1992-09-03  |  1.5 KB  |  33 lines  |  [TEXT/ttxt]

  1. GetKeys 2.0
  2.  
  3. GetKeys is a free software utility written by Bryan K. “Beaker” Ressler.
  4.  
  5. GetKeys is a utility designed to make it easier for C programmers to check for key depressions with the Event Manager routine GetKeys. GetKeys returns a KeyMap, which is four longs, with one or more bits set in the map that represent the keys that are currently depressed.
  6.  
  7. The code to check for a particular key is not particularly attractive. For instance, to check whether the "a" key is depressed, you'd use code like this:
  8.  
  9. Boolean IsTheAKeyDown(void)
  10. {
  11.     KeyMap  keyMap;
  12.  
  13.     GetKeys(keyMap);
  14.     return (keyMap[0] >> 24) & 0x01;
  15. }
  16.  
  17. As you can see, the expression in the return statement is rather…opaque. It is hard to translate from the key you want to detect to such an expression.
  18.  
  19. Well, not any more.
  20.  
  21. GetKeys shows you the current GetKeys key map in hexadecimal. Also, if a single key is depressed, it generates a C-language expression that can be used to detect that key. The GetKeys window contains a Copy button, which will copy the displayed C code expression into the clipboard, which you can then paste into your code.
  22.  
  23. GetKeys is free. It may not be distributed for profit without my express written permission. Please distribute GetKeys with this file.  Code is © 1992 Bryan K. Ressler, all rights reserved worldwide.
  24.  
  25. Bryan K. “Beaker” Ressler
  26. 4660 Persimmon Place
  27. San Jose, CA 95129
  28.  
  29. AppleLink: ADOBE.BEAKER
  30. American Online: Beaker3
  31. Internet: bressler@adobe.com
  32. Prodigy: SGTJ13A
  33.